{% extends "Common/AdminBase.html" %}
{% load filters %} 
{% block Location %}

<li class="current" ><a href='/AdminMain/Board/Index/'>留言板</a></li>
<li>/</li>
<li class="current">编辑留言</li>
<script>
//设置当前导航
Nav_Page="Board";
</script>

{% endblock %}


{% block content %}

 

<div class="contentcontainer">
	
            <div class="headings alt">
                <h2>编辑留言板</h2>
            </div>
            <div class="contentbox">
            	<form action="#" AjaxForm="/AdminMain/Board/DoEdit/" AjaxVerify='OnChange'    AjaxSuccess="onRefresh">
            	  <div style="width:100%;float:left">
					<p style="float:left;width:350px">
                        <label for="textfield"><strong>姓名</strong></label>
                        <input id="ApplyUserName" maxlength="20"  name="ApplyUserName" type="text" value='{{Model.ApplyUserName}}'  class="inputbox"> 
						<br>
                    </p>
                   
					<p style="float:left;">
                        <label  for="textfield"><strong>电话</strong></label>
                        <input id="ApplyPhone" maxlength="20"  name="ApplyPhone" type="text" value='{{Model.ApplyPhone}}'  class="inputbox"> 
						<br>
                    </p>
				</div>
				
				 <div style="width:100%;float:left">
					<p style="float:left;width:350px">
                        <label for="textfield"><strong>邮箱</strong></label>
                        <input id="ApplyMail" maxlength="100"  name="ApplyMail" type="text" value='{{Model.ApplyMail}}'  class="inputbox">
						<br>
                    </p>
					
					<p style="float:left;">
                        <label for="textfield"><strong>提交时间</strong></label>
						 <input type="text" disabled  class="inputbox" value='{{Model.ApplyTime|date:"Y-m-d"}}'>
						<br>
                    </p>
					
				</div>
					
				<div style="width:100%;float:left">
					<p style="float:left;width:350px">
                        <label for="textfield"><strong>内容</strong></label>
                            <textarea id="ApplyContent" name="ApplyContent" style=" width:320px; height:100px; text-align:left">{{Model.ApplyContent}}</textarea>
						
						   	<br><span id="ApplyContentspan" class="smltxt red"></span>
						<br>
                    </p>
					
					<p style="float:left;">
                        <label for="textfield"><strong>回复内容</strong></label>
						 <textarea id="ReplyContent" name="ReplyContent" style=" width:320px; height:100px; text-align:left">{{Model.ReplyContent}}</textarea>
						 	<br>  <span id="ReplyContentspan" class="smltxt red"></span>
						<br>
                    </p>
				</div>
					<p style="float:left;width:350px">
				
                    	<input id="IsOpen"   type="checkbox"  
						
						{% ifequal Model.IsOpen True %}
						checked="checked"
						{% endifequal %}
						
						> 显示在首页
						
							<input type="hidden" id="h_IsOpen"  name="IsOpen" value="{{Model.AnonymousReply}}">
							
							<br>	 	<br>	
						<input type="hidden" name="MessageId" value="{{Model.MessageId}}">
                         <input type="submit" id="submitoChange" value="提  交" class="btn"> 
						 
						 <input type="button" value="返 回" class="btnalt" onclick=" window.location='/AdminMain/Board/Index'" >
					</p>
					   
                   
                </form>
					
               </div>
          
        </div>
		

<script>

 function OnChange()
 {
 	if($("#IsOpen").attr("checked")==true)
	{
		$("#h_IsOpen").val("True")
	}else
	{
		$("#h_IsOpen").val("False")
	}
	
	
 	$("#ReplyContentspan").html("");
	$("#ApplyContentspan").html("");
    if($("#ReplyContent").val().length>500)
	{
		$("#ReplyContentspan").html("回复内容不能超过500字");
		
	}else if($("#ApplyContent").val().length>500)
	{
		$("#ApplyContentspan").html("留言内容不能超过500字");
	}else
	{
		return true;
	}
 
	return false;
 }
 
 function onRefresh()
{
$.tips("操作成功",null,2,function(){
	window.location='/AdminMain/Board/Index/'
});
}
 
 

</script>
          
    
		
{% endblock %}

